\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{graphicx} 
\usepackage{float}
\usepackage[left=1cm,right=1cm,top=1cm,bottom=2cm]{geometry}
\title{NumPDE Homework 8}
\author{Jiang Zhou 3220101339}
\date{2025/6/8}

\begin{document}
\maketitle
\section{Exercise 12.42}
Let $U \in L^1(h\mathbb{Z})$. That is,

$$
\sum_{m \in \mathbb{Z}} |U(m)|h < \infty.
$$

We are given the Fourier transform:

$$
\hat{U}(\xi) = \frac{1}{\sqrt{2\pi}} \sum_{m \in \mathbb{Z}} e^{-imh\xi} U(m)h,
\quad \text{for } \xi \in \left[-\frac{\pi}{h}, \frac{\pi}{h}\right],
$$

and its inverse:

$$
U(m) = \frac{1}{\sqrt{2\pi}} \int_{-\frac{\pi}{h}}^{\frac{\pi}{h}} e^{imh\xi} \hat{U}(\xi) \, d\xi.
$$

We need to show that plugging $\hat{U}$ into this inverse formula exactly recovers $U(m)$.

$$
\begin{aligned}
U(m)
&= \frac{1}{\sqrt{2\pi}} \int_{-\frac{\pi}{h}}^{\frac{\pi}{h}} e^{imh\xi} \hat{U}(\xi) \, d\xi \\
&= \frac{1}{\sqrt{2\pi}} \int_{-\frac{\pi}{h}}^{\frac{\pi}{h}} e^{imh\xi} \left( \frac{1}{\sqrt{2\pi}} \sum_{n \in \mathbb{Z}} e^{-inh\xi} U(n)h \right) d\xi \\
\end{aligned}
$$

Due to \(\sum_{m \in \mathbb{Z}} |U(m)|h < \infty.\) Then we can interchange the sum and the integral:
$$
\begin{aligned}
U(m)= \frac{1}{2\pi} \sum_{n \in \mathbb{Z}} U(n)h \int_{-\frac{\pi}{h}}^{\frac{\pi}{h}} e^{ih\xi(m - n)} \, d\xi.
\end{aligned}
$$


Note:

$$
\int_{-\frac{\pi}{h}}^{\frac{\pi}{h}} e^{ih\xi(m - n)} \, d\xi =
\begin{cases}
\int_{-\frac{\pi}{h}}^{\frac{\pi}{h}} 1 \, d\xi = \frac{2\pi}{h}, & \text{if } m = n, \\
\frac{e^{i\pi(m-n)} - e^{-i\pi(m-n)}}{ih(m - n)} = 0, & \text{if } m \ne n,
\end{cases}
$$

since $e^{i\pi(m-n)} - e^{-i\pi(m-n)} = 2i \sin(\pi(m - n)) = 0$ for integer $m \ne n$.

So:
$$
\int_{-\frac{\pi}{h}}^{\frac{\pi}{h}} e^{ih\xi(m - n)} \, d\xi = \frac{2\pi}{h} \delta_{mn}.
$$

$$
\begin{aligned}
U(m)
&= \frac{1}{2\pi} \sum_{n \in \mathbb{Z}} U(n)h \cdot \frac{2\pi}{h} \delta_{mn} \\
&= \sum_{n \in \mathbb{Z}} U(n) \cdot \delta_{mn} \\
&= U(m).
\end{aligned}
$$



\section{Exercise 12.49}
The  $\theta$-method is given by:
\begin{align*} 
&-\theta rU_{i-1}^{n+1}+(1+2\theta r)U_i^{n+1}-\theta rU_{i+1}^{n+1}\\
&= (1-\theta)rU_{i-1}^n +[1-2(1-\theta)r]U_i^n+(1-\theta)rU_{i+1}^n. 
\end{align*}
which implies:
\begin{align*}
    &-\theta r\hat{U}^{n+1}e^{-ih\xi}+(1+2\theta r)\hat{U}^{n+1}-\theta r\hat{U}^{n+1}e^{ih\xi}\\
    &= (1-\theta)r\hat{U}^ne^{-ih\xi} +[1-2(1-\theta)r]\hat{U}^n+(1-\theta)r\hat{U}^n e^{ih\xi}. 
\end{align*}
Since the Fourier transform is unique, we have  \(\hat{U}^{n+1}(\xi) = g(h\xi)\hat{U}^n(\xi)\), where
\begin{align*}
g(h\xi) &= \frac{(1-\theta)re^{-ih\xi}+[1-2(1-\theta)r] +(1-\theta)r e^{ih\xi} }{-\theta r e^{-ih\xi}+(1+2\theta r)-\theta re^{ih\xi}}\\
&= \frac{2(1-\theta)r\cos(h\xi)+[1-2(1-\theta)r]}{-2\theta r cos(h\xi)+(1+2\theta r)}\\
&= -\frac{2(1-\theta)r[\cos(h\xi)-1]+1}{2\theta r[cos(h\xi)-1]-1}\\
&= \frac{1-4(1-\theta)r\sin^2(\frac{h\xi}{2})}{4\theta r\sin^2(\frac{h\xi}{2})+1}.
\end{align*}
\subsection{For \(\theta \in [\frac{1}{2}, 1]\):}
Analyze the molecules and the denominator of its fraction:
\begin{align*}
    1 \geq 1 - 4(1-\theta)r\sin^2(\frac{h\xi}{2}) &\geq 1 - 4(1-\theta)r \geq -1 \\
    4\theta r\sin^2(\frac{h\xi}{2})+1 &\geq 1
\end{align*}
As a result, we have: \(|g(h\xi)|\leq1\), which implies the method is unconditionally stable.

\subsection{For \(\theta \in [0,\frac{1}{2})\):}
Analyze the molecules and the denominator of its fraction:
\begin{align*}
    1 \geq 1 - 4(1-\theta)r\sin^2(\frac{h\xi}{2}) &\geq 1 - 4(1-\theta)r  \\
    4\theta r\sin^2(\frac{h\xi}{2})+1 &\geq 1
\end{align*}
So:
\begin{align*}
    g(h\xi) =  \frac{1-4(1-\theta)r\sin^2(\frac{h\xi}{2})}{4\theta r\sin^2(\frac{h\xi}{2})+1} leq -1 \Longleftrightarrow k < \frac{h^2}{2(1-2\theta)r}. 
\end{align*}
Then the method would be stable.

Both Von Neumann analysis and the stability function analysis yield the same time step restriction
\section{Exercise 12.79}
For \(a\geq 0\), the Beam-Warming method is given by:
\begin{align*}
    U_j^{n+1} &= U_j^n - \frac{\mu}{2}(3U_{j}^n - 4U_{j-1}^n + U_{j-2}^n) + \frac{\mu^2}{2}(U_{j}^n - 2U_j^n + U_{j-2}^n)\\
\end{align*}
\begin{align*}
    \tau(x,t) &= \frac{u(x, t+k)- u(x,t)}{k} + \frac{a}{2h}[3u(x, t) - 4u(x-h,t) + u(x-2h, t)] - \frac{a^2k}{2h^2}[u(x, t) - 2u(x-h,t) + u(x-2h,t)]\\
    &= \frac{ku_t + \frac{k^2}{2}u_{tt} + O(k^3)}{k} + \frac{a}{2h}[2hu_x+O(h^3)] - \frac{a^2k}{2h^2}[h^2u_{xx} - h^3u_{xxx} + O(h^4)]\\
    &= u_t + \frac{k^2}{2}u_{tt} + au_x-\frac{a^2k}{2}u_{xx} + \frac{a^2kh}{2}u_{xxx} + O(k^2+h^2)\\
    &= \frac{a^2 k h}{2} u_{xxx} + O(k^2 + h^2).
\end{align*}
Thus, the local truncation error is:
\[
\tau(x,t) = O(k^2 + h^2).
\]
The Beam-Warming method is second-order accurate both in time and in space.

\section{Exercise 12.80}
\subsection{Stability for \(a \geq 0\) (Method 12.90a)}
\[
\lambda_p = -\frac{a}{2h}\left(3 - 4e^{-i\theta} + e^{-2i\theta}\right) + \frac{a^2k}{2h^2}\left(1 - 2e^{-i\theta} + e^{-2i\theta}\right),
\]
where \(\theta = 2\pi ph\). Substituting \(\mu = \frac{a k}{h}\), we get:
\[
z_p = k \lambda_p = -\frac{\mu}{2}\left(3 - 4e^{-i\theta} + e^{-2i\theta}\right) + \frac{\mu^2}{2}\left(1 - 2e^{-i\theta} + e^{-2i\theta}\right).
\]
The forward Euler stability condition requires \(|1 + z_p| \leq 1\). Simplifying \(z_p\):
\[
z_p = -\frac{\mu}{2}(3 - 4\cos\theta + \cos 2\theta) + \frac{\mu^2}{2}(1 - 2\cos\theta + \cos 2\theta) + i\left(\frac{\mu}{2}(4\sin\theta - \sin 2\theta) - \frac{\mu^2}{2}(2\sin\theta - \sin 2\theta)\right).
\]
The magnitude condition \(|1 + z_p|^2 \leq 1\) reduces to:
\[
\text{Re}(1 + z_p)^2 + \text{Im}(z_p)^2 \leq 1.
\]
After algebraic manipulation (using \(\cos 2\theta = 2\cos^2\theta - 1\) and \(\sin 2\theta = 2\sin\theta \cos\theta\)):
\[
|1 + z_p|^2 = 1 - 2\mu(1 - \cos\theta)^2(2 - \mu).
\]
For stability:
\[
2\mu(1 - \cos\theta)^2(2 - \mu) \geq 0.
\]
Since \((1 - \cos\theta)^2 \geq 0\) and \(\mu \geq 0\), we require:
\[
2 - \mu \geq 0 \implies \mu \leq 2.
\]
Conclusion: The method (12.90a) is stable for \(\mu \in [0, 2]\).
\subsection{Stability for \(a < 0\) (Method 12.90b)}
The eigenvalue for \(a < 0\) is:
\[
\lambda_p = -\frac{a}{2h}\left(-3 + 4e^{i\theta} - e^{2i\theta}\right) + \frac{a^2k}{2h^2}\left(1 - 2e^{i\theta} + e^{2i\theta}\right).
\]
Substituting \(\mu = \frac{a k}{h}\) (note \(\mu < 0\)):
\[
z_p = -\frac{\mu}{2}\left(-3 + 4e^{i\theta} - e^{2i\theta}\right) + \frac{\mu^2}{2}\left(1 - 2e^{i\theta} + e^{2i\theta}\right).
\]
The stability condition \(|1 + z_p| \leq 1\) simplifies to:
\[
|1 + z_p|^2 = 1 + 2\mu(1 - \cos\theta)^2(2 + \mu) \leq 1.
\]
Since \(\mu \leq 0\) and \((1 - \cos\theta)^2 \geq 0\), we require:
\[
2 + \mu \geq 0 \implies \mu \geq -2.
\]
Conclusion: The method (12.90b) is stable for \(\mu \in [-2, 0]\).
\subsection{Reproduce the plots}
As shown in Figure\ref{fig:12-80}:
\begin{figure}
    \centering
    \includegraphics[width=0.4\textwidth]{figure/12_80.png}
    \caption{Stability regions for the Beam-Warming method.}
    \label{fig:12-80}
\end{figure}
\section{Exercise 12.83}
As shown in Figure\ref{fig:12-83}::
\begin{figure}
    \centering
    \includegraphics[width=0.6\textwidth]{figure/12_83.png}
    \caption{The numerical domains of dependence for the upwind method\((a<0)\)}
    \label{fig:12-83}
\end{figure}

\section{Exercise 12.84}
As shown in Figure\ref{fig:12-84}::
\begin{figure}
    \centering
    \includegraphics[width=0.6\textwidth]{figure/12_84.png}
    \caption{The numerical domains of dependence for Lax-Wendroff method}
    \label{fig:12-84}
\end{figure}

\section{Exercise 12.93}
The leapfrog method is given by:
\[
U_j^{n+1} = U_j^{n-1} - \mu(U_{j+1}^n - U_{j-1}^n), \quad \mu = \frac{ak}{h}.
\]
Substituting the exact solution \(v(x,t)\) and expanding in Taylor series about \((x,t)\):
\[
0 = \frac{v(x,t+k) - v(x,t-k)}{2k} + \frac{a}{2h}\left(v(x+h,t) - v(x-h,t)\right).
\]
After Taylor expansion and differentiation of the PDE \(v_t + av_x = 0\), we obtain:
\[
v_t + av_x + \frac{1}{6}k^2v_{ttt} + \frac{1}{6}ah^2v_{xxx} + \mathcal{O}(k^4 + h^4) = 0.
\]
Using the relations:
\[
v_{ttt} = -a^3v_{xxx} + \mathcal{O}(k^2), \quad v_{xxt} = -av_{xxx} + \mathcal{O}(k^2), \quad v_{xtt} = a^2v_{xxx} + \mathcal{O}(k^2),
\]
we simplify to:
\[
v_t + av_x + \frac{ah^2}{6}(1 - \mu^2)v_{xxx} + \mathcal{O}(k^4 + h^4) = 0.
\]
Thus the modified equation is:
\[
v_t + av_x + \frac{ah^2}{6}(1 - \mu^2)v_{xxx} = 0. 
\]
Retaining higher-order terms yields:
\[
v_t + av_x + \frac{ah^2}{6}(1 - \mu^2)v_{xxx} = \epsilon_f v_{xxxxx}. 
\]
For the Lax-Wendroff method, the modified equation is:
\[
v_t + av_x + \frac{ah^2}{6}(1 - \mu^2)v_{xxx} = \epsilon_w v_{xxxx}. 
\]


\section{Exercise 12.94}
The Beam-Warming scheme for \(a \geq 0\) is:
\[
U_j^{n+1} = U_j^n - \frac{\mu}{2}\left(3U_j^n - 4U_{j-1}^n + U_{j-2}^n\right) + \frac{\mu^2}{2}\left(U_j^n - 2U_{j-1}^n + U_{j-2}^n\right), \quad \mu = \frac{ak}{h}.
\]
Substituting the exact solution \(v(x,t)\) and Taylor expanding about \((x,t)\):
\[
0 = \frac{v(x,t+k) - v(x,t)}{k} + \frac{a}{2h}\left(3v(x,t) - 4v(x-h,t) + v(x-2h,t)\right) - \frac{a^2k}{2h^2}\left(v(x,t) - 2v(x-h,t) + v(x-2h,t)\right).
\]
After simplification and using PDE relations:
\[
v_t + av_x + \frac{ah^2}{6}(-2 + 3\mu - \mu^2)v_{xxx} + \mathcal{O}(k^3 + h^3) = 0.
\]
The modified equation is:
\[
v_t + av_x + \frac{ah^2}{6}(\mu - 1)(\mu - 2)v_{xxx} = 0.
\]
The dispersion relation is:
\[
\omega(\xi) = a\xi - \frac{ah^2}{6}(\mu - 1)(\mu - 2)\xi^3.
\]
Phase velocity:
\[
C_p(\xi) = \frac{\omega}{\xi} = a + \frac{ah^2}{6}(\mu - 1)(\mu - 2)\xi^2.
\]
Group velocity:
\[
C_g(\xi) = \frac{d\omega}{d\xi} = a + \frac{ah^2}{2}(\mu - 1)(\mu - 2)\xi^2.
\]

\section{Exercise 12.95}
At \(\mu = 1\), both methods satisfy:
\[
v_t + av_x + \frac{ah^2}{6}(1 - \mu^2)v_{xxx} = 0 \implies v_t + av_x = 0.
\]
\begin{itemize}
    \item \textbf{Lax-Wendroff:} Artificial viscosity vanishes. This reduces dissipation but may increase oscillations and instability risk due to undamped high-frequency components.
    \item \textbf{Leapfrog:} Leading-order dispersive error vanishes, improving phase accuracy.
\end{itemize}
Setting \(\mu = 1\) eliminates leading-order dispersive errors for both methods. For Lax-Wendroff, it also removes artificial viscosity, potentially reducing damping.

\section{Exercise 12.97}
The scheme for \(a \geq 0\) is:
\[
U_j^{n+1} = \frac{1}{2}\left(U_{j+1}^n + U_{j-1}^n\right) - \frac{\mu}{2}\left(U_{j+1}^n - U_{j-1}^n\right), \quad \mu = \frac{ak}{h}.
\]
Assume a Fourier mode \(U_j^n = g^ne^{i\xi jh}\). Substituting gives:
\[
g = \cos(\xi h) - i\mu\sin(\xi h).
\]
The squared modulus is:
\[
|g|^2 = \cos^2(\xi h) + \mu^2\sin^2(\xi h).
\]
Stability requires \(|g| \leq 1\) for all \(\xi\):
\[
\cos^2(\xi h) + \mu^2\sin^2(\xi h) \leq \cos^2(\xi h) + \sin^2(\xi h) \implies (\mu^2 - 1)\sin^2(\xi h) \leq 0.
\]
This holds iff \(|\mu| \leq 1\).\\
The method is stable iff \(|\mu| \leq 1\).

\section{Exercise 12.98}
The scheme is:
\[
U_j^{n+1} = U_j^n - \frac{\mu}{2}\left(U_{j+1}^n - U_{j-1}^n\right) + \frac{\mu^2}{2}\left(U_{j+1}^n - 2U_j^n + U_{j-1}^n\right), \quad \mu = \frac{ak}{h}.
\]
Assume \(U_j^n = g^ne^{i\xi jh}\). Substituting gives:
\[
g = 1 - i\mu\sin(\xi h) + \mu^2(\cos(\xi h) - 1).
\]
Using \(\cos(\xi h) - 1 = -2\sin^2(\xi h/2)\):
\[
g = 1 - 2\mu^2\sin^2\left(\frac{\xi h}{2}\right) - i\mu\sin(\xi h).
\]
The squared modulus is:
\[
|g|^2 = \left(1 - 2\mu^2\sin^2\frac{\xi h}{2}\right)^2 + \mu^2\sin^2(\xi h).
\]
Substitute \(\sin(\xi h) = 2\sin(\xi h/2)\cos(\xi h/2)\):
\[
|g|^2 = \left(1 - 2\mu^2 s\right)^2 + 4\mu^2 s(1 - s), \quad s = \sin^2(\xi h/2).
\]
Simplification shows \(|g|^2 \leq 1\) iff \(|\mu| \leq 1\).\\
The method is stable iff \(|\mu| \leq 1\).

\section{12.3 Programming assignments}
\begin{figure}
    \centering
    \includegraphics[width=0.6\textwidth]{figure/12_3_2.png}
    \caption{Reproduce all results in Example 12.88.}
    \label{fig:12-3}
\end{figure}

\end{document}
